﻿using BootstrapBlazor.Components;
using SqlSugar;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace OnWork.DataCenter.Shared.Pages.DataSource
{
    public class DataBaseConfigVO
    {
        /// <summary>
        /// 主键
        /// </summary>
        [AutoGenerateColumn(Visible = false, Readonly = true)]
        public long ID { get; set; }

        /// <summary>
        /// 数据连接名称
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空"), MaxLength(255)]
        [AutoGenerateColumn(Text = "连接名", Searchable = true, Filterable = true, Sortable = true), DisplayName("连接名")]
        public string Name { get; set; }

        /// <summary>
        /// 数据库类型 SqlSuger类型
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [AutoGenerateColumn(Text = "数据库类型", Searchable = false, Filterable = false, Sortable = true), DisplayName("数据库类型")]
        public DbType Type { get; set; } = DbType.SqlServer;

        /// <summary>
        ///数据联接 SqlSuger 字符串
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [AutoGenerateColumn(Text = "连接字符串", Searchable = true, Filterable = true, Sortable = true), DisplayName("连接字符串")]
        public string ConnStr { get; set; }
    }
}